<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //1. 打印人的一生，从一岁到一百岁
        var age = 1;
        while (age <= 100) {
            console.log('你已经' + age + '岁了');
            age ++;
        }


        //2.计算1到100 之间所有整数的和
        var num = 1;
        var sum = 0;
        while (num <= 100) {
            sum += num;
            num ++;
        }
        console.log('1到100之间所有整数和为：' + sum);


        //弹出一个输入框，你爱我吗？ 如果输入我爱你，就提示结束，否则，一直循环
        var ask = prompt('你爱我吗？');
        while ( ask != '我爱你') {
            ask = prompt('你爱我吗？');
        }
        alert('我也爱你吖！');
    </script>
</head>
<body>
    
</body>
</html>